package battle 
{
	import Common.MapDirection;
	/**
	 * ...
	 * @author 
	 */
	public class BattlePos 
	{
		public var x:int = 0;
		public var y:int = 0;
		
		public function BattlePos() 
		{
			
		}
		
		
		public static function GetDirect( pos1:BattlePos , pos2:BattlePos ):int
		{
			var x:int = pos1.x - pos2.x;
			var y:int = pos1.y - pos2.y;
			
			var direction:int = MapDirection.DIRECTCOUNT;
			
			if ( x > 0 && y > 0 ) 
				direction = MapDirection.SOUTHEAST;
			else if ( x > 0 && y == 0 ) 
				direction = MapDirection.EAST;
			else if ( x > 0 && y < 0 ) 
				direction = MapDirection.NORTHEAST;
			else if ( x == 0 && y < 0 ) 
				direction = MapDirection.NORTH;
			else if ( x < 0 && y < 0 ) 
				direction = MapDirection.NORTHWEST;
			else if ( x < 0 && y == 0 ) 
				direction = MapDirection.WEST;
			else if ( x < 0 && y > 0 ) 
				direction = MapDirection.SOUTHWEST;
			else if ( x == 0 && y > 0 ) 
				direction = MapDirection.SOUTH;
				
			return direction;
		}
		
	}

}